home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / bbs / termv4.6 / extras / source / term-source.lha / xem.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-18  |  4.9 KB  |  145 lines

  1. /**
  2.  *
  3.  *   Include file for External Emulator Handling
  4.  *
  5.  **/
  6.  
  7. /*
  8.  *   The structure
  9.  */
  10.  
  11. struct XEM_IO
  12. {
  13.     struct Window    *xem_window;
  14.     struct TextFont    *xem_font;
  15.     APTR         xem_console;
  16.     STRPTR         xem_string;
  17.     ULONG        *xem_signal;
  18.     UWORD         xem_screendepth;
  19.     UWORD         xem_pad;
  20.  
  21.     ULONG        (* __asm xem_sread)(register __a0 APTR,register __d0 LONG,register __d1 ULONG);
  22.     LONG        (* __asm xem_swrite)(register __a0 STRPTR,register __d0 LONG);
  23.     LONG        (* __asm xem_sflush)(VOID);
  24.     LONG        (* __asm xem_sbreak)(VOID);
  25.     ULONG        (* __asm xem_squery)(VOID);
  26.     VOID        (* __asm xem_sstart)(VOID);
  27.     LONG        (* __asm xem_sstop)(VOID);
  28.  
  29.     VOID        (* __asm xem_tbeep)(register __d0 ULONG,register __d1 ULONG);
  30.     LONG        (* __asm xem_tgets)(register __a0 STRPTR,register __a1 STRPTR,register __d0 ULONG);
  31.     ULONG        (* __asm xem_toptions)(register __d0 LONG,register __a0 struct xem_option **);
  32.  
  33.     LONG        (* __asm xem_process_macrokeys)(register __a0 struct XEmulatorMacroKey *);
  34. };
  35.  
  36. /*
  37.  *   The xem_option structure
  38.  */
  39.  
  40. struct xem_option
  41. {
  42.     STRPTR    xemo_description;    /* description of the option                  */
  43.     ULONG    xemo_type;        /* type of option                             */
  44.     STRPTR    xemo_value;        /* pointer to a buffer with the current value */
  45.     ULONG    xemo_length;        /* buffer size                                */
  46. };
  47.  
  48. /*
  49.  *   Valid values for xemo_type are:
  50.  */
  51.  
  52. #define XEMO_BOOLEAN 1L         /* xemo_value is "yes", "no", "on" or "off"   */
  53. #define XEMO_LONG    2L         /* xemo_value is string representing a number */
  54. #define XEMO_STRING  3L         /* xemo_value is a string                     */
  55. #define XEMO_HEADER  4L         /* xemo_value is ignored                      */
  56. #define XEMO_COMMAND 5L         /* xemo_value is ignored                      */
  57. #define XEMO_COMMPAR 6L         /* xemo_value contains command parameters     */
  58.  
  59. struct XEmulatorMacroKey
  60. {
  61.     struct MinNode    xmk_Node;
  62.     UWORD        xmk_Qualifier;
  63.     UBYTE        xmk_Type;
  64.     UBYTE        xmk_Code;
  65.     APTR        xmk_UserData;
  66. };
  67.  
  68. /*----- Qualifiers for XMK_QUALIFIER -----*/
  69.  
  70. #define XMKQ_NONE      0
  71. #define XMKQ_SHIFT     1
  72. #define XMKQ_ALTERNATE 2
  73. #define XMKQ_CONTROL   3
  74.  
  75. /*----- Types for XMK_TYPE -----*/
  76.  
  77. #define XMKT_IGNORE 1
  78. #define XMKT_RAWKEY 2
  79. #define XMKT_COOKED 3
  80.  
  81.  
  82. /*----- Types for XEmulatorInfo -----*/
  83.  
  84. #define XEMI_CURSOR_POSITION    1    /* home = 1,1 */
  85. #define XEMI_CONSOLE_DIMENSIONS    2
  86.  
  87. /*----- Macros for XEmulatorInfo -----*/
  88.  
  89. #define XEMI_EXTRACT_Y_POSITION(result)    (result >> 16)
  90. #define XEMI_EXTRACT_X_POSITION(result)    (result & 0xffff)
  91.  
  92. #define XEMI_EXTRACT_COLUMNS(result)    (result >> 16)
  93. #define XEMI_EXTRACT_LINES(result)    (result & 0xffff)
  94.  
  95. /*----- Modes for XEmulatorPreferences -----*/
  96.  
  97. #define XEM_PREFS_RESET    0    /* Reset to builtin defaults    */
  98. #define XEM_PREFS_LOAD    1    /* Load preferences from file    */
  99. #define XEM_PREFS_SAVE    2    /* Save preferences to file    */
  100.  
  101.  
  102. struct XEmulatorHostData
  103. {
  104.     STRPTR    Source;
  105.     STRPTR    Destination;
  106.     BOOL    InESC;        /* INTER-EMULATOR PRIVATE DATA..  DO NOT TOUCH 'EM..!! */
  107.     BOOL    InCSI;        /* INTER-EMULATOR PRIVATE DATA..  DO NOT TOUCH 'EM..!! */
  108. };
  109.  
  110. BOOL    XEmulatorSetup(struct XEM_IO *io);
  111. BOOL    XEmulatorOpenConsole(struct XEM_IO *io);
  112. VOID    XEmulatorCloseConsole(struct XEM_IO *io);
  113. VOID    XEmulatorCleanup(struct XEM_IO *io);
  114. VOID    XEmulatorWrite(struct XEM_IO *io, STRPTR string, ULONG len);
  115. BOOL    XEmulatorSignal(struct XEM_IO *io, ULONG sig);
  116. ULONG    XEmulatorHostMon(struct XEM_IO *io, struct XEmulatorHostData *hd, ULONG actual);
  117. ULONG    XEmulatorUserMon(struct XEM_IO *io, STRPTR retstr, ULONG maxlen, struct IntuiMessage *imsg);
  118. BOOL    XEmulatorOptions(struct XEM_IO *io);
  119. BOOL    XEmulatorClearConsole(struct XEM_IO *io);
  120. BOOL    XEmulatorResetConsole(struct XEM_IO *io);
  121. BOOL    XEmulatorResetTextStyles(struct XEM_IO *io);
  122. BOOL    XEmulatorResetCharset(struct XEM_IO *io);
  123. ULONG    XEmulatorGetFreeMacroKeys(struct XEM_IO *io, ULONG qualifier);
  124. BOOL    XEmulatorMacroKeyFilter(struct XEM_IO *io, struct List *keys);
  125. ULONG    XEmulatorInfo(struct XEM_IO *xem_io, ULONG type);
  126. BOOL    XEmulatorPreferences(struct XEM_IO *xem_io, STRPTR fileName, ULONG mode);
  127.  
  128. #pragma libcall XEmulatorBase XEmulatorSetup 1E 801
  129. #pragma libcall XEmulatorBase XEmulatorOpenConsole 24 801
  130. #pragma libcall XEmulatorBase XEmulatorCloseConsole 2A 801
  131. #pragma libcall XEmulatorBase XEmulatorCleanup 30 801
  132. #pragma libcall XEmulatorBase XEmulatorWrite 36 9803
  133. #pragma libcall XEmulatorBase XEmulatorSignal 3C 802
  134. #pragma libcall XEmulatorBase XEmulatorHostMon 42 9803
  135. #pragma libcall XEmulatorBase XEmulatorUserMon 48 A09804
  136. #pragma libcall XEmulatorBase XEmulatorOptions 4E 801
  137. #pragma libcall XEmulatorBase XEmulatorClearConsole 54 801
  138. #pragma libcall XEmulatorBase XEmulatorResetConsole 5A 801
  139. #pragma libcall XEmulatorBase XEmulatorResetTextStyles 60 801
  140. #pragma libcall XEmulatorBase XEmulatorResetCharset 66 801
  141. #pragma libcall XEmulatorBase XEmulatorGetFreeMacroKeys 6c 802
  142. #pragma libcall XEmulatorBase XEmulatorMacroKeyFilter 72 9802
  143. #pragma libcall XEmulatorBase XEmulatorInfo 78 802
  144. #pragma libcall XEmulatorBase XEmulatorPreferences 7E 9803
  145.